[译]Docker开发最佳实践

原文地址:Docker development best practices

下面的开发模式已经被证明有助于人们使用Docker构建应用程序。如果你发现了我们应该补充的东西,请告诉我们

How to keep your images small

启动容器或服务时,小镜像在网络上传输更快,在内存中加载更快。有一些经验法则可以使镜像保持较小尺寸:

Where and how to persist application data

Use swarm services when possible

swarm服务的节点之间共享数据有一些限制。如果你使用Docker for AWSDocker for Azure,你可以使用Cloudstor插件在swarm服务节点之间共享数据。您还可以将应用程序数据写入支持同步更新的单独数据库

Use CI/CD for testing and deployment

Differences in development and production environments